#!/bin/sh

## arg 1:  the new package version
post_install() {
  if ! getent group mailman >/dev/null; then
    groupadd -g 80 mailman >/dev/null
  fi

  if ! getent passwd mailman >/dev/null; then
    useradd -s /sbin/nologin -c "GNU Mailing List Manager" -d /usr/lib/mailman \
      -u 80 -g mailman -M -r mailman >/dev/null
  fi
  # check file permissions
  cd /usr/lib/mailman && bin/check_perms > /dev/null
}

## arg 1:  the new package version
## arg 2:  the old package version
post_upgrade() {
  # check file permissions
  cd /usr/lib/mailman && bin/check_perms > /dev/null
}

## arg 1:  the old package version
post_remove() {
  userdel -f mailman >/dev/null 2>&1 || true
  groupdel mailman >/dev/null 2>&1 || true
}

# vim:set ts=2 sw=2 ft=sh et:
